# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test11
# Description:  例25.12
# Author:       ASUS
# Date:         2019/4/8
#-------------------------------------------------------------------------------


import pandas as pd
scientists = pd.read_csv("scientists.csv")
#输出所有Age大于平均平均值的记录
print(scientists[scientists['Age'] > scientists['Age'].mean()])
print('------------------------------')
#只显示索引为0，1，3的记录
print(scientists.loc[[True,True,False,True]])
print("-----------------")
#只显示索引1，3，4的记录
print(scientists.iloc[[1,3,4]])
print("------------------")
print(scientists[['Name','Age','Occupation']][scientists['Age'] > scientists['Age'].mean()].head(2))
print('-------------------------------')
print(scientists[['Name','Age','Occupation']][scientists['Age'] > scientists['Age'].mean()].loc[[True,True]])
print("------------------------")
print(scientists[['Name','Age','Occupation']][scientists['Age'] > scientists['Age'].mean()].iloc[[0,2]])